<extend name="Public:base" />

<block name="content-wrapper">
	<!-- Content Wrapper. Contains page content -->
	<div class="content-wrapper">
		<!-- Content Header (Page header) -->
		<section class="content-header">
			<h1>
				管理员详情
				<small>Administrator Detail</small>
			</h1>
			<ol class="breadcrumb">
				<li>
					<a href="{:U('Index/index')}"> <i class="fa fa-dashboard"></i>
						首页
					</a>
				</li>
				<li>
					<a href="{:U('Administrator/index')}">管理员管理</a>
				</li>
				<li class="active">管理员详情</li>
			</ol>
		</section>

		<!-- Main content -->
		<section class="content">
			<div class="row col-sm-8 col-sm-offset-2">
				<div class="box">
					<div class="box-header with-border">
						<h3 class="box-title">表单</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->
					<div class="box-body">
						<form id="form-detail" class="form-horizontal">
							<div class="form-group">
								<label class="col-sm-2 control-label">用户名</label>
								<div class="col-sm-9">
									<input id="username" type="text" class="form-control" value="{$administrator.username}" disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">密码</label>
								<div class="col-sm-9">
									<input id="password" type="text" class="form-control" value="{$administrator.password}" disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">姓名</label>
								<div class="col-sm-9">
									<input id="name" type="text" class="form-control" value="{$administrator.name}" disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">超级管理员</label>
								<div class="col-sm-9">
									<select id="is_supervisor" class="form-control" disabled="disabled">
										<eq name="administrator.is_supervisor" value="1">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										<else />
											<option value="1">是</option>
											<option value="0"  selected="selected">否</option>
										</eq>
					                 </select>
								</div>
							</div>
						</form>
					</div>
					<!-- /.box-body -->
					<div class="box-footer">
						<a href="{:U('Administrator/index')}" type="button" class="btn btn-default pull-right">返回</a>
					</div>
					<!-- /.box-footer -->
				</div>				
			</div>

		</section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->
</block>

<block name="additional-scripts">
	<script>
		$(function () {
			$('#academy_id').change(function() {
				var academy_id = $('#academy_id').val();
				$.post('__MODULE__/Class/getMajorsByAcademyId',
				{
					academy_id: academy_id
				},
				function(data, status) {
					$('#major_id').empty();
					var majors = data;
					for(var key in majors) {
						$('#major_id').append('<option value="' + majors[key]['id'] + '">' + majors[key]['name'] + '</option>');
					}
				});	
			});
		});
	</script>
</block>